Fix compilation problems with opencv2 and linking problems