diff --git a/acinclude.m4 b/acinclude.m4
index c3c3e12b47651364ca1045a892e6fe51dce931ea..c4c822d702665298e6fc5af004f6dded9036005a 100644
--- a/acinclude.m4
+++ b/acinclude.m4
@@ -88,8 +88,10 @@ if test "x${PBX_$1}" != "x1" -a "${USE_$1}" != "no"; then
          fi
          $1_LIB=""
          $1_INCLUDE=""
-         PBX_$1=0
       else
+         if test "x${pbxfuncname}" = "x" ; then		# only checking headers -> no library
+	    $1_LIB=""
+	 fi
          PBX_$1=1
          AC_DEFINE_UNQUOTED([HAVE_$1], 1, [Define to indicate the ${$1_DESCRIP} library])
       fi