Should I connect the ground in the outlet for the dryer and the panel?
Older electric dryer circuits allowed the use of 120/240V non-grounding 3-prong receptacles. These were NEMA 10-50 configuration. In these circuits the neutral served as both the neutral and the grounding conductor.
If the ground wire existed though it definitely should have been used, but it is not uncommon to find what you describe.

I would certainly terminate the ground at the panel at the very least. A best case scenario would be to replace the receptacle with a 4-prong dryer receptacle and change the cord on the dryer to match.