Micheal Martin has been elected the Republic of Irelands prime minister for a second term after a vote in parliament on Thursday.