Aiden Markram and Hashim Amla struck half-centuries before India battled back on day one of the second Test at Centurion.