Could you provide a link to the Makefile you’re talking about. Don’t really know about any specific flags but as long ‘raspberry pi OS’ means some kind of linux I guess things should compile…
I’m not sure I’m getting it right. Are you compiling on pi for pi or are you cross compiling?