President Donald Trump has hailed the “brave men and women” of the US military at 4 July celebration.