Out-of-tree compilation fails if you do out-of-tree cmake build and make build sequentially.
Evidently configure's out-of-tree build sometimes pulls in a stale zconf.h
(either the system's, or the default one checked into the top of the source tree)
rather than the one it generated.