A ground wire needs to be connected to the ground bar in the breaker panel where the branch circuit originates. If you have only hot&neutral leaving the breaker panel, and then further on the circuit someone used Romex with ground to extend a circuit, you will need to run additional wire to ensure that the receptacle is truly grounded and not just wired to a ground that goes nowhere.
In some areas (check your local codes), a circuit can be grounded to a copper or iron plumbing pipe, using the appropriate clamps and connectors.
You can also test the receptacle using one of these guys, once you've got it wired up: