The leaders of the Group of Seven rich economies ended a summit Friday by issuing an action plan for countering terrorism and other risks to peace and global growth, including the massive flows of refugees and migrants fleeing to Europe to escape conflict and poverty at home.