Substitute '-' for '_' in APP_NAME for Debian packaging.
Fix build scripts so examples and tools will build on all platforms.