Improved rules for gnu/wget

We have to hack the Makefiles and add several libraries to LIBS, or
nothing in the test suite will compile