The amplifier should be grounded to the chassis of the car, as close to the amp as possible. The head unit should be grounded to the amp's ground connection.
Remember when trying to find engine noise, that electricity follows the path of least resistance, so if you have a nice big juicy ground at the amp, and a shitty amp at the head unit, you will hear noise, which is current flowing through the car to that nice ground. Occasionally, you may have good grounds on the stereo system itself, and have to improve factory grounds elsewhere in the car, such as on the battery, the electric fuel pump, etc.
If you go this route, just work through them one by one, giving the system a listen after improving each ground until you nail it.
Sometimes purchasing a ground loop isolator will fix or reduce engine noise.