-ACX_PTHREAD(CC="${PTHREAD_CC}", , echo "Can't find POSIX threads library"; exit 1 )
+ACX_PTHREAD([CFLAGS="$CFLAGS $PTHREAD_CFLAGS" LDFLAGS="$PTHREAD_LIBS $LDFLAGS" CC="$PTHREAD_CC"],
+ [AC_MSG_ERROR([POSIX thread support required])])
dnl Trying to locate the X window system's includes and libraries, and sets the
dnl variables x_includes and x_libraries to their locations. Also adds the
dnl Trying to locate the X window system's includes and libraries, and sets the
dnl variables x_includes and x_libraries to their locations. Also adds the
-CFLAGS="${CFLAGS} ${PTHREAD_CFLAGS} ${SNDFILE_CFLAGS} ${OPENSSL_CFLAGS}"
-LIBS="${PTHREAD_LIBS} ${SNDFILE_LIBS} ${OPENSSL_LIBS} ${LIBS}"
+CFLAGS="${CFLAGS} ${SNDFILE_CFLAGS} ${OPENSSL_CFLAGS}"
+LIBS="${SNDFILE_LIBS} ${OPENSSL_LIBS} ${LIBS}"