Donald Trump has told the US military to treat rocks being thrown by migrants at the border as though they were rifles being fired.