Countries must do more to make migration safe, legal, pope says