corrected linking order (Fixes #1)

modern linkers try to keep dependencies to a minimum and do not link against libraries that are not needed.
unfortunately the heuristic is a bit simplistic, as it all the object files are only evaluated once.
this basically means that if 'main.o' depends on 'libfoo'  we have to do:
  $ ld -o main main.o -lfoo
rather than
  $ ld -o main -lfoo main.o