Correct includes and linking for cgm and model tests.