Fix dependencies

I made sure that all shared libraries built and that all symbols were resolved at build time.
Also added a few missing transitive dependencies. The list might still be incomplete.