Sudan's ousted Prime Minister Abdalla Hamdok has been reinstated following last month's coup, when he was put under house arrest.