I think the other solutions are missing the point. I'm seeing the same error trying to build libpng with the prebuilt zlib binaries I got from here:
I think the binaries included are fine, but the zconf.h file is from the Linux build and so includes a reference to unistd.h. If you just use the binaries they should be fine, but if you include zconf.h in a Windows build then you get an error. I just commented out the offending block and my build worked fine as well.