added more explicit shared and static linking flags so we dont run into linking problems