Fix compiling using linux qt4 and osx qt5

The zlib include changes in first commit are needed for both linux qt4 and osx qt5.