President Macron has appointed a new prime minister, hours after François Bayrou was forced to tender his resignation.