James Anderson took a wicket in his first over for the second time in the first Test after pinning Aiden Markram lbw.