--- configure.orig	2009-04-16 22:02:06.000000000 +0200
+++ configure	2009-05-05 20:42:19.000000000 +0200
@@ -6287,6 +6287,7 @@
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 $ac_includes_default
+#include <sys/param.h>
 #include <sys/ucred.h>
 _ACEOF
 rm -f conftest.$ac_objext
@@ -7643,7 +7644,7 @@
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   ac_check_lib_save_LIBS=$LIBS
-LIBS="-ldbus-1 `$PKGCONFIG --libs dbus-1` $LIBS"
+LIBS="-ldbus-1 `$PKGCONFIG --libs dbus-1` $LIBS -pthread"
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
@@ -11782,6 +11783,7 @@
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 $ac_includes_default
+#include <netinet/in.h>
 #include <resolv.h>
 _ACEOF
 rm -f conftest.$ac_objext
@@ -16791,7 +16793,7 @@
 
 
 	if test x$ac_cv_header_pthread_h = xyes; then
-				for flag in -lpthreads -lpthread -pthread; do
+				for flag in -pthread; do
         		{ echo "$as_me:$LINENO: checking for pthread_create using $flag" >&5
 echo $ECHO_N "checking for pthread_create using $flag... $ECHO_C" >&6; }
 			SAVELIBS="$LIBS"
