Add shared library option to build system