Fixing cmake with threads