The -l flag means "link against these libraries when compiling the code" .
Thus, just as -lxml2 refers to "libxml2" and -lm refers to "libm" (math library), it is reasonable to assume that -lz refers to libz, which I would guess is a compression library.
If you run "locate libz" or failing that, "find / -name libz -print" , do you get any filenames? Perhaps the library is just in a different location.