Optimal control for evolutionary imperfect transmission problems