His comments came three days after North Korea carried out its first ballistic missile test in two months, in defiance of UN resolutions.
The latest missile flew higher than any others previously tested, before falling into Japanese waters.
Tensions have heated up in recent months over the north's continued development of its nuclear and missile programme, in spite of global condemnation and international sanctions. Pyongyang conducted its first nuclear test in September.
The Pentagon was also reported to be scouting sites on the west coast of America to deploy extra defences, amid claims from North Korea that its latest missile could reach the whole of continental United States.
President Donald Trump's national security adviser gave his unscripted comments at a forum in California on Saturday.
"There are ways to address this problem short of armed conflict, but it is a race because he's getting closer and closer, and there's not much time left," Mr McMaster said, in reference to North Korean leader Kim Jong-un.
He singled out China, urging the Beijing government to enforce a total oil embargo on the north to make it difficult to fuel missile launches.
"We're asking China to act in China's interest, as they should, and we believe increasingly that it's in China's urgent interest to do more."
"You can't shoot a missile without fuel," he added.
North Korea, meanwhile, has accused the US and neighbouring South Korea of being warmongers ahead of large-scale joint air exercises between the two allies that begin on Monday.
"It is an open, all-out provocation against the DPRK [North Korea], which may lead to a nuclear war any moment," an editorial in the ruling party's Rodong newspaper said.
North Korea said the Hwasong-15 missile it fired on Thursday, which reached an altitude of 4,475km (2,780 miles) and flew 950km in 53 minutes, could have been tipped with a "super-large heavy warhead" capable of striking the US mainland.
However, while analysts agree the missile could have travelled more than 13,000km on a standard trajectory and reach the US, they have cast doubts over whether the missile would have been able successfully to carry a heavy warhead that distance.
They do not believe North Korea has mastered the technology to prevent the warhead from breaking up as it re-enters the Earth's atmosphere.
More about: #NorthKorea