Fixes CMakeFiles pthread usage