Fix build with shared libraries, regression from 10cf08f
Drop the extra CIP library argument in target_link_libraries() and
reorder the remaining libraries so linking works both for static
and shared libraries.
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>