Fix check for pthreads library on Ubuntu.