On Mojave, mac ./configure: error: Please install zlib and zlib-devel packages

sudo installer -pkg /Library/Developer/CommandLineTools/Packages/macOS_SDK_headers_for_macOS_10.14.pkg -target /

 

The reason is because Xcode Command Line tools no longer installs needed headers in /include. You have to run a separate command to install the needed headers.