$OpenBSD: patch-configure,v 1.4 2012/07/13 09:05:38 naddy Exp $
--- configure.orig	Wed Jul 11 13:42:33 2012
+++ configure	Wed Jul 11 13:44:46 2012
@@ -3860,7 +3860,8 @@ if test "x$ac_cv_lib_pthread_pthread_create" = x""yes;
 #define HAVE_LIBPTHREAD 1
 _ACEOF
 
-  LIBS="-lpthread $LIBS"
+  CFLAGS="-pthread $CFLAGS"
+  LIBS="-pthread $LIBS"
 
 else
   as_fn_error $? "\"POSIX Threads is required to compile mpg321.\"" "$LINENO" 5
@@ -5739,7 +5740,7 @@ if test "x$enable_alsa" = "xyes"; then
 $as_echo "yes" >&6; }
 else
         CFLAGS="$CFLAGS"
-	LIBS="$LIBS -lz -lpthread -lm"
+	LIBS="$LIBS -lz -lm"
 	check_alsa="no"
         { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
 $as_echo "no" >&6; }
