The problem with libpng install is solved.
The reason for the failure apparently appears to be version incompatibility, partly may be due to libpng-1.6.6 being unstable and has conflict with the zlib-1.2.8 being previously installed.
I uninstalled zlib-1.2.8 and reinstalled the older but stable release zlib-1.2.7 and instead of libpng-1.6.6, downloaded and installed libpng-1.5.9 and libpng installation passed the test successfully!
There was no zlib_reset - 'inflateReset2' problem this time. Don't know if there was a better solution, but I seemed to have bypassed the problem anyway. So the ideal compatible versions are zlib-1.2.7/libpng-1.5.9 instead of zlib-1.2.8/libpng-1.6.6 which I had been trying! Hope this helps.