Can I make an unarmed strike while holding a two handed weapon?

My barbarian Gus uses a Greataxe, a two handed weapon. While raging in combat against harpies, a round passed without Gus taking damage. On his turn, all harpies were out of his melee range, and he had used all his javelins. To maintain his rage, he slapped the fighter with an unarmed strike. The DM ruled that Gus could not make a unarmed strike, as he was wielding a 2 handed weapon. I argued that he was not wielding the 2 handed weapon, just holding it; my DM didn’t see the difference, and as long as Gus held a 2 handed weapon his weapon attacks must be made with that weapon. In the end I dropped the weapon, slap the fighter, then pick up the weapon as a free object interaction. Then he reminded me that rage is only maintained by attacking a hostile opponent, but that’s not important here.

I understand that a 2 handed weapon only requires 2 hands when you attack with it, and my DM agrees with that. The only debate is whether you can, while holding the weapon with 1 hand, make an unarmed strike with your other hand. The description for unarmed strikes seems to imply that you could make an unarmed strike with full hands:

Instead of using a weapon to make a melee weapon Attack, you can use an Unarmed Strike: a punch, kick, head-butt, or similar forceful blow.

Even if I did have full hands, could I have head butted the fighter here? enter link description hereWas my DM correct in this ruling, or was I?