--- libxml2-2.8.0/configure.in.orig	2012-05-23 10:33:55.000000000 +0200
+++ libxml2-2.8.0/configure.in	2012-08-08 00:20:20.544880094 +0200
@@ -958,12 +958,17 @@
     dnl Use pthread by default in other cases
     if test -z "$THREADS_W32"; then
         if test "$with_threads" = "pthread" || test "$with_threads" = "" || test "$with_threads" = "yes" ; then
+            LIBS_saved="$LIBS"
             AC_CHECK_HEADER(pthread.h,
-                AC_CHECK_LIB(pthread, pthread_join,[
-                THREAD_LIBS="-lpthread"
+                AC_SEARCH_LIBS(pthread_join, pthread,[
+                THREAD_LIBS="$ac_cv_search_pthread_join"
+                if test "$THREAD_LIBS" = "none required"; then
+                  THREAD_LIBS=""
+                fi
                 AC_DEFINE([HAVE_LIBPTHREAD], [], [Define if pthread library is there (-lpthread)])
                 AC_DEFINE([HAVE_PTHREAD_H], [], [Define if <pthread.h> is there])
                 WITH_THREADS="1"]))
+            LIBS="$LIBS_saved"
         fi
     fi
 
