Cross-distro support for building libgraphics.so

This expands upon the addition in #52 by ytterbium, which added the building of `libgraphics.so` from the open source DF code to fix PNG related bugs as per #36.

My changes simplify the building process across various distributions that use different library paths for 32bit ad 64bit libs.

Note: this includes the code in #52 as of May 1, 2014