Dynamics of an impact oscillator near a degenerate graze