Upgrade sugar_target_link_libraries

Add support for debug/optimized libraries.
Merge branch 'update' into update.macosx