Check for -lpthread in configure.