Fix linkage when system already has gecode libs installed

Thanks to Paulo Cesar Pereira de Andrade.