cmake: link dependency fixes