Fix r_static interface includes and compiler flags