Hehe, everyone will notice the stem missing and you will be incessantly harassed by any average passerby at making such a novice mistake!
It depends on the stem and how woody it is. If its a fairly solid stem, shoot a wood screw up through the bottom of the lid into it. Just be careful when lifting the lid so you don't wallow out the hole in the soft pumpkin flesh. If the stem is pretty fibrous, you might want to drill a hole into it using a paddle bit and use wood glue to glue a chunk of dowel into it. Then use a smaller bit and dowel and drill through crosswise through the stem and other dowel from the back (but not all the way through) and place a cross plug through the stem and first dowel to prevent it from pulling out. A bit of brown shoe polish on the end of the cross dowel will hide it well. Then shoot the wood screw like above, into the dowel through the pumpkin lid. In either case, I would use a bit of waterproof wood glue between the stem and the pumpkin to prevent flexing and provide additional holding.