lib: build shared library across systems

Add shared library glue for GNU and enable build across all systems.
This, however, doesn't mean the shared library is working on all
systems.  Truth is most linkers behave differently and have their own
pitfalls.  If you chose to use the shared library, you are on your
own.

Suggested-by: Sunil Nimmagadda <sunil AT sunilnimmagadda DOT com>