libxml2 hardcodes -L/lib in zlib/lzma tests which breaks cross-compiles

For https://bugzilla.gnome.org/show_bug.cgi?id=749416

do not use -L$Z_DIR/lib when Z_DIR isn't actually set
diff --git a/configure.ac b/configure.ac
index 6f012c9..af8ec25 100644
--- a/configure.ac
+++ b/configure.ac
@@ -400,7 +400,9 @@
      if test "x$have_libz" = "xno"; then
         AC_CHECK_HEADERS(zlib.h,
             [SAVE_LDFLAGS="${LDFLAGS}"
-             LDFLAGS="-L${Z_DIR}/lib"
+	    if test "x${Z_DIR}" != "x"; then
+	        LDFLAGS="${LDFLAGS} -L${Z_DIR}/lib"
+	    fi
             AC_CHECK_LIB(z, gzread,[
                 have_libz=yes
                 if test "x${Z_DIR}" != "x"; then