CMake: tweaks for shared mode

Signed-off-by: Eduardo Silva <eduardo@monkey.io>