For some reason -lcgic was statically added in the Makefile. I put it in to configure.
Changed paths: