LD_PRELOAD=/usr/lib/libpthread.so fixes it. It's the libc stubs. I don't know what to link against libpthread but pkgsrc is cheating by having glmark2 linked with libpthread.