Update CMakeLists.txt

Fixes a library linking error with pthread that occurs on some machines