use R's C compiler for configure checks
fix format string warning; thanks Dirk