Elanco reaches agreement with activist investor, avoiding me