Some distributions can't support shared libraries

Heiko Thiery reports that some embedded distributions that link
against uLibc can't support shared libraries. So, refactor the
Makefiles to support

  make SHARED=no ...

(SHARED defaults to yes).

Signed-off-by: Andrew G. Morgan <morgan@kernel.org>
diff --git a/Make.Rules b/Make.Rules
index 0e7192c..360e258 100644
--- a/Make.Rules
+++ b/Make.Rules
@@ -80,9 +80,16 @@
 INCS=$(topdir)/libcap/include/sys/capability.h
 LDFLAGS += -L$(topdir)/libcap
 CFLAGS += -Dlinux $(WARNINGS) $(DEBUG)
-PAM_CAP ?= $(shell if [ -f /usr/include/security/pam_modules.h ]; then echo yes ; else echo no ; fi)
 INDENT := $(shell if [ -n "$$(which indent 2>/dev/null)" ]; then echo "| indent -kr" ; fi)
-DYNAMIC := $(shell if [ ! -d "$(topdir)/.git" ]; then echo yes; fi)
+
+# SHARED tracks whether or not the SHARED libraries (libcap.so,
+# libpsx.so and pam_cap.so) are built. (Some environments don't
+# support shared libraries.)
+SHARED ?= yes
+# DYNAMIC controls how capsh etc are linked - to shared or static libraries
+DYNAMIC := $(shell if [ ! -d "$(topdir)/.git" ]; then echo $(SHARED); else echo no ; fi)
+
+PAM_CAP ?= $(shell if [ -f /usr/include/security/pam_modules.h ]; then echo $(SHARED) ; else echo no ; fi)
 
 # If your system does not support pthreads, override this as "no".
 #