Search zlib without pkg-config

NetBSD has zlib installed in base system and no .pc file for it. In
order to discover it, fallback to AC_CHECK_LIB is PKG_CHECK_MODULES
fail to find it.

This is a backport of Ide84402aa38edc2709d12e2530401c6b8c722529
and I34ded175f056d1a0898804fe602e3d2d2cba27f5

BUG: 1138897
Change-Id: I14a3ab987cf2bedd3d1d00145466647fb646795b
Signed-off-by: Emmanuel Dreyfus <manu@netbsd.org>
Reviewed-on: http://review.gluster.org/8628
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Vijay Bellur <vbellur@redhat.com>