Irish lawmakers have voted to make veteran politician Micheál Martin prime minister for a second time at the helm of a coalition government.