Gary Madine fired a late winner as Hartlepool beat Yeovil 2-1 at home to extend their unbeaten National League run to six matches.