build: add a function to test if -lc is needed