Added shared lib generation for linux

Modified to also generate so for Linux. 
Generalized the shared library target so you should test to make sure it still works for OSX.
Shared libs generated in shared directory