The previous commit meant to avoid adding an LDFLAG but it just avoided
the issue. The real issue is PNG_BUILD_ZLIB being turned to ON. This
variable is for specifying a custom zlib location, which is not
necessary. Switching it to OFF calls find_package and links properly.
Backported two zlib related patches. The latter is a somewhat impoarant
fix.
Signed-off-by: Rosen Penev <rosenp@gmail.com>