Also define UNITTESTS macro when building unit test sources. Fixing compiler warning: external definition with no prior declaration
When configure --enable-debug has been used, all files in lib/ are now built twice and a separate static library crafted for unit-testing will be linked. The unit tests in the tests/unit subdir will use that library.
This is the first approach at doing fairly clean and easy to write and debug unit tests.