Move pthread dependency to test CMakeLists.txt