I see you removing this struct here, but I am actually not able to compile because parts of the meterpreter code rely on this struct, such as netstat.c.

Did you re-add the struct somewhere else? Or possible miss adding a modified netstat.c?