Cannot find /lib/libc.so.6
You didn't indicate what gcc version you are using, but if it is a recent enough one (4.0.0 and above me thinks) you should try adding the --sysroot
flag to g++/ld. Point it to $SYSROOT as defined in your Makefile. For example:
--sysroot=$(SYSROOT)
Assuming recent enough gcc version, it will work.
I just went through the same issue; adding --sysroot=/rootfs/prefix helped me get closer to the real issue. I got it fixed by installing package libstdc++-dev in target.