Fix pthread linking with gtest

Otherwise I have linking errors.