Unless he began acting erratically or started shuffling the clerk into the back room, quietly get your get your gun out and wait for him to collect the cash and leave.
Be a good witness.
Handgun bullets don't vaporize bad guys. You could try to shoot him while he's task fixated and cause him to shoot the clerk. You could draw his attention so he's not pointing to gun at the clerk then exchange gunfire and hopefully not get ventilated yourself or you could wait until he walks out the door with someone else's likely insured money and call the police.
Be a good witness.
Handgun bullets don't vaporize bad guys. You could try to shoot him while he's task fixated and cause him to shoot the clerk. You could draw his attention so he's not pointing to gun at the clerk then exchange gunfire and hopefully not get ventilated yourself or you could wait until he walks out the door with someone else's likely insured money and call the police.