Concatenating data together will seldom generate a valid PE executable unless you modify the PE header to consider that extra data. It might actually "work" right now because the Windows version is forgiving in loading the file and the 7z executable loads the payload from disk but the fact remains that your PE executable is invalid and might not work on some Windows versions.
The good news though is that by using a resource compiler you will solve both your problems: Both the icon and the payload are typically resources so you could have an "empty" 7z executable that you add an icon and your data to using a resource compiler.
I never tried compiling windows executables on Unix, but if I would, I'd look at Wine, IIRC it has a resource compiler that works on Unix.