Set some build flags.
#!/bin/bash
-$R CMD INSTALL --build .
+
+export CFLAGS="$(Magick++-config --cflags)"
+export LDFLAGS="$(Magick++-config --libs)"
+
+export LIB_DIR="$(Magick++-config --libs)"
+
+$R CMD INSTALL --configure-vars="LIB_DIR={$LIB_DIR}" --build .
