Add check for zlib and add to linker

Should solve https://bugs.gentoo.org/show_bug.cgi?id=480464 and
https://github.com/Sabayon/mate-overlay/issues/46