Fix some compilation issues with legacy targets

Added some includes, removed some hardcode paths
in the makefiles, and added xtra data max size define
that was missing from last commit.

Change-Id: Idf64464589fb68efc7e75710ce635e40a6fc25e0
19 files changed