Sorry to
not be suggesting a cheap solution. (Yeah...there's the overdub idea.)
However...I'd strongly suggest getting
iZotope RX in your toolbox. You'll want the Standard edition, because it includes Spectral Repair. The De-hum thing that's included in the economy "Elements" version is just a notch filter arrangement that works a lot more poorly than you would hope...even though it seems to be the "correct" tool.
I know you are probably just trying to solve this
one problem...right now...and just once. Consider though that you'll also encounter similar (or worse) problems down the road if you spend any significant time and energy in recording.
I'm just sayin...
On the other hand...if the hum is low enough that it's masked when the guitar is actually playing, you could try using a gate set to close when the guitar gets out of the way. I think there's at least two of these included with SONAR.
The problem with using EQ as a solution...particularly when your ground hum presents itself as a "buzz"...is that you need to notch out all the harmonics as well as the 60 Hz fundamental frequency. That ends up doing significant damage to the signal you are trying to keep. Besides...it just doesn't work all that well in my experience.