fix libpng-1.6 compilation and make paths modifiable

you might want to test if this still behaves on win32 as expected, but it should