build: Enabling ability to use precompiled headers and some other build fixes

Change-Id: If2b216e5674fc762338929026733f3dcb801bb1b
Refs: #1588