update inter-library linking to avoid needing --no-as-needed

As described in the update to the README in
8ab8ec8d45c1921d992007086f74ba442778e71a
Ubuntu now requires libraries to explicitly link all of the other
libraries upon which they depend. One way around this is to use
the --no-as-needed linker flag to revert to the old behaviour.

This commit attempts to add all of the necessary inter-library
linking. On my Ubuntu 12.04 system, without using the --no-as-needed
flag, I can now "make world", and also build/run most of the library
tests (make check) -- there are exceptions, but they do not appear to
be related to linker problems.