Use Threads package from CMake.