sim: look for packages before setting cflags.

Without this change we were trying to do the '-include ...config.h'
which hadn't yet been generated causing the package searches to fail on
a fresh build.