Use automake to generate VPATH-compatible makefiles

This is needed for cross compiling, for instance with MinGW.
Create 512x512 directory

https://bugs.freedesktop.org/show_bug.cgi?id=87107