Refactoing Makefile and fix a small bug

- Refactoring Makefile. Use default variables. Remove clutters
- Fix bug: implicit convert double to long (function misused).
  boost::posix_time::seconds only accept variables of type long.
  Therefore when a double is passed, it's implicitly converted to long,
  which turn 0.5 to 0.
  Solution: Use boost::posix_time::milliseconds