Fix a linker error by linking against pthreads.