Add util to CMakeLists to search for pthread libraries and link them.