For prototype devices (which should last several months and are OK to fail occasionally), it is usually enough to mount the PCB on rubber inserts instead of bare screws). This greatly reduces peak accelerations your PCB sees, while keeping your prototype accessible and requiring minimum design changes.
For commercial products which should last 10 years or more, you want something more robust. I have seen automotive electronics where parts are assembled (or even the whole device is potted) with RTV silicone, which greatly helps with both mechanical sturdiness and heat transfer.
Read More: Automotive Electronic Manufacturing