Fixed some minor bugs in the Makefiles for test and viewer.

* both programs now have obj/libviewer.a as a prerequisite
* test no longer links against libSDL since that is not used anymore