When compiling your application, link against the zlib you just built:
Unlike .gz or .bz2 , .xz requires xz decompression. zlib1213tarxz
Historically, source code was distributed as .tar.gz (gzip). More recently, projects have moved to .tar.xz (XZ compression). When compiling your application, link against the zlib