The US ambassador to the UN has said that the country prefers not to use military action against North Korea, but would if it had to.