Check for pthreads library.

This fixes a link error on my ARM devices.