Marques Ackerman scored a career-best 157 and shared a 202-run stand with Zubayr Hamza to lead South Africa's spirited fightback against Bangladesh in the first Test in Johannesburg.