Clean and portable way of generating a working libcharm.so
Relevant to CharmPy and maybe other potential future applications.
There is no good way to generate a single libcharm.so file that can be used from CharmPy.
This should be integrated into the build process (using charmc), and also to guarantee that the
produced library has all required dependencies (both static and dynamic) on all systems.