fix compile bug and add debug flag to C compiler