Rebel chief Riek Machar says he will form a government with President Salva Kiir after years of fighting.