Fix the CMake build on Windows when using PThreads