Link MWDC and GEM libraries explicitly against libTreeSearch.so.

This causes libTreeSearch.so to be loaded automatically when any of the
sub-libraries is loaded. Otherwise, we'd get undefined symbols if the
user forgets to load the core library. Works at least on Linux.