Edited CMakeFiles to make iCub compiles with SHARED libraries on OS X

To fix https://github.com/robotology/icub-main/issues/39