Backport GCC fix from trunk.
Don't append libs in pre-processor mode.