Build Updates: Fix Linker Order and Tests

Fixes the linker order bug reported by Piin-Ruey Pan (thx!) and builds the new `tests/` directory by default, too.

- `-lpng` has to be linked after `-lpngwriter` since pngwriter will leave open symbols to libpng that have to be "filled up" afterwards
- one could alternatively add an additional target for `tests` but since neither the examples nor tests should/will be installed that should be fine