For CMake/Xcode avoid passing external LIBS to target_link_libraries.

This branch contains the fix for #581 

PTAL