[package] fix zlib linking failures with gcc-4.4+ (#6173)