fix compilation on OSX

* better dependancies handling for external project
* SHARED compilation flag set to default for OSX