The short answer is basically no.
when you compile something, it builds in static code that is platform dependent. For example, with a .c program, the c standard library that is linked in is platform-dependent; that is, you aren't going to have the "same" standard library when you compile a C program on windows as you will when you compile on Linux. Now, to be clear, it will look and act the same, but I mean the standard library is basically a "standard" way for you to access the platform dependent functionality; for printf(), for example, with windows it will eventually call the WriteFile/WriteFileEx() or some equivalent to write the data to the standard output. With Linux, it will eventually end up calling the appropriate syscall.
It's not possible to somehow include both and then include a check when it starts because that would imply the use of function pointers for every single Standard library function, not to mention it would nearly double the size of the executable.
This extends to the compiled form of most script languages, which usually just embed a script interpreter that has to run on the desired platform, thus being limited to the aforementioned issues.
Of course with a language such as Java or .NET that runs in a Virtual Machine, this is not really much of an issue; the same executable for many .NET applications, if written for the case, can run just fine on either Linux (via Mono) or on a windows machine, and java is of course a living example of this. I think if the machine doesn't have java and your application can't run you have to think hard about whether the person using said machine really wants to run your program at all.
Thing is, people have already thought "it would be nice to have one program I could compile and run that compiled program on a variety of machines" and the result was java and various other VM based languages that you have essentially discarded, essentially because they need an installed VM. Of course they do. This is a case of "wanting your cake and eating it too" in that you want to advantages that running as VM bytecode gives you (platform independence) without the costs (having to have the VM installed)