Updated to statically link to libz if possible