By gearbox - do you mean the gearbox/transmission, or the final drive which houses the ring&pinion gear at the rear wheel end?
How many miles are on the bike? These airhead transmissions do have a bit of "clunkiness" normally, too.
First thing I'd check is to put bike on centerstand, tip it forward so that rear wheel is in the air/front wheel on ground. One can put a jackstand under the rear frame crossmember to hold it this way.
Leaving the bike in gear, slowly turn the rear wheel forward and backward to find out how much "free play" exists in the driveline before it tries to turn the engine. Try this simple test and let us know how much free play - estimate by inches or cm of wheel travel - your bike has.
Possible sources of excess travel/play can be:
1. worn out drive splines in final drive (final drive has center drive tube with splines that mesh with mating spline assembly riveted inside rear wheel hub. If the teeth on these are getting worn down to pointy peaks (originally they are square edged teeth) this will cause excess rear wheel slop/play.
2. There is a cush drive (spring tensioned coupling) in the driveshaft. If this has become worn or the spring has broken you will have strange sounds and excess play in the driveshaft.
3. There is also a shaft inside the gearbox with coupled lobes to absorb driveline shock feeding back into the transmission. It is somewhat rare, but not unheard of, for one of the the lobes to break - though this is not common occurrence, and I'd expect that you'd see metal shards in your gearbox oil if you drained it if this happened.
AFter you do the rear wheel test, it may not hurt to pull the rear wheel off anyhow and have a look at the rear wheel hub splines. These should be cleaned/relubed with a high moly content grease every few years at least. I do mine 1x per year, and with any tire changes, brake service, etc.
Let us know how the first test comes out and we can proceed from ther