link libraries to correct executable in cmake