libz should only be a dependency of libcfitsio, but not directly of Healpix C++ itself. If this is the case, do we actually need the test? I think in this case the test should be dropped as there is no dependency. The libcfitsio.pc pkg-config file already correctly declares -lz as a dependency in Libs.private for static linking, and for dynamic linking, libcfitsio.so correctly has libz.so linked in. So from my cursory look, it can be dropped.
zlib detection is incorrect
For me statifying ffmpeg doesn't work (--verbose says Symbol '\''_dl_argc'\'' not found in the interpreter), but I've uploaded another executable that apparently has the same problem.
You are right, this is gnupg behaving badly. Maybe you could file this upstream?
Revocation certificate claims export has been successful with wrong pass phrase