Specify include and lib dir as required by configure script.
#!/bin/bash
-export C_INCLUDE_PATH=$PREFIX/include
-export CC=gcc
+# Below variables overwrite hardcoded paths in configure script.
+export INCLUDE_DIR=$PREFIX/include
+export LIB_DIR=$PREFIX/lib
$R CMD INSTALL --build .
