Fixed Makefile to build all targets without conflicts.

Fixed tests where they assumed presence of /dev/tty.

Added building shared library.

Added intall targets for all libraries, headers and executables.
Merge pull request #19 from keithj/devel

Various build improvements
Added missing Perl module targets. This bug was obscured because the
CI tests did not 'make clean'.
Moved the Perl module targets to the correct place.
Merge pull request #20 from keithj/devel

Added missing Perl module targets
Restored Perl library targets and added a test_perl target.
Merge pull request #21 from keithj/devel

Restored Perl library targets and added a test_perl target
Resolved merge conflicts