How to tighten threadless headset? Top cap has no thread
On threadless headsets the top cap has a bolt passing through it that threaded into either an expansion plug or star nut that is pressed into the steerer tube.  Tightening the bolt pulls the top cap down which compresses the headset bearings.

I'm guessing your top cap bolt is missing. Any local bike shop will be able to provide a replacement. Perhaps the expansion plug, no longer attached to the top cap, has dropped down into the steerer tube. Have a look down the steerer tube with a bright light. You may be able to fish it out with a length of coat-hanger wire.