Refactoring of configuration

* Reduce the number of substitutions, instead use and build CPPFLAGS
  in configure.ac

* Add configuration specific for solaris

Signed-off-by: Stefan Widgren <stefan.widgren@gmail.com>