Don't know where that "-lzlib" comes from. The library name to link is simply "z" -> "-lz", and that's detected at configure time.
checking for gzgets in -lz... yes checking for zlib.h... yes
Upstream bug causing this: https://github.com/Homebrew/homebrew-core/issues/130258
Build problem -> will push fix in as soon as have one tested.
Attached patch that works at least for main branch. (resolves os_x failure)
Worked on all branches.
os_x job on CI: