Added check for pthread, required by C++11 threads