How to create static binary which runs on every distro?
Ensure that all your resources are contained in the executable and link the executable statically:
gcc -o foo main.o -static -lbaz -lbar
However, this also has drawbacks. Look up dynamic linking.