diff -Naur avrdude-6.0.1/configure.ac avrdude-6.0.1-haiku/configure.ac
--- avrdude-6.0.1/configure.ac	2013-09-18 06:19:42.038010880 +0000
+++ avrdude-6.0.1-haiku/configure.ac	2014-01-13 23:01:38.477102080 +0000
@@ -96,6 +96,7 @@
 
 AC_SEARCH_LIBS([gethostent], [nsl])
 AC_SEARCH_LIBS([setsockopt], [socket])
+AC_SEARCH_LIBS(socket, socket network)
 AH_TEMPLATE([HAVE_LIBUSB],
             [Define if USB support is enabled via libusb])
 AC_CHECK_LIB([usb], [usb_get_string_simple], [have_libusb=yes])
@@ -176,11 +177,8 @@
 fi
 AC_CHECK_HEADERS([pthread.h])
 # as there exits header file only pthread implementations for Windows, check if we have a library
-AC_CHECK_LIB([pthread], [pthread_create], [have_pthread=yes])
-if test x$have_pthread = xyes; then
-   LIBPTHREAD="-lpthread"
-fi
-AC_SUBST(LIBPTHREAD, $LIBPTHREAD)
+AC_SEARCH_LIBS([pthread_create], [pthread], [have_pthread=yes])
+
 # Checks for header files.
 AC_CHECK_HEADERS([limits.h stdlib.h string.h])
 AC_CHECK_HEADERS([fcntl.h sys/ioctl.h sys/time.h termios.h unistd.h])
diff -Naur avrdude-6.0.1/Makefile.am avrdude-6.0.1-haiku/Makefile.am
--- avrdude-6.0.1/Makefile.am	2013-09-18 05:59:07.037224448 +0000
+++ avrdude-6.0.1-haiku/Makefile.am	2014-01-13 21:50:05.837550080 +0000
@@ -63,7 +63,7 @@
 
 libavrdude_a_CFLAGS   = @ENABLE_WARNINGS@
 
-avrdude_LDADD  = $(top_builddir)/$(noinst_LIBRARIES) @LIBUSB_1_0@ @LIBUSB@ @LIBFTDI1@ @LIBFTDI@ @LIBHID@ @LIBELF@ @LIBPTHREAD@ -lm
+avrdude_LDADD  = $(top_builddir)/$(noinst_LIBRARIES) @LIBUSB_1_0@ @LIBUSB@ @LIBFTDI1@ @LIBFTDI@ @LIBHID@ @LIBELF@
 
 bin_PROGRAMS = avrdude
 
