Make sure to build libpthread to check for HAVE_PTHREAD_MUTEX_LOCK.