improved compilation system for R interface with autotools using R CMD to call flags,
tested in Linux and Mac