Add support for building without PThread to the CMake files