Trajectory tracking in linear hybrid systems: an internal model principle approach