Irish lawmakers have voted to make veteran politician Micheál Martin prime minister for a second time, leading a coalition government.