build-sys: try to get collect-symbols right when cross-compiling.
build-sys: removed old cruft, safer flex/bison checks.
build-sys: check for malloc only if we're not cross-compiling.