fix ncurses and libc building process