Fix bugs in build system

1. Fix processing of .d files.
2. In the dependencies of .a, compute .o's from .c's; don't just
   use the .o's that are there.
3. Make all.do generate .a, which generates .o's.