Fixed sample plugins compilation when using a LIBDIR value other than
the default (issue #479)

Fixed the build number generation at compilation time.