because I tried with +static-libs and it broke.

Where should I add that?