[Makefile] makefile tasks to work with python2 and 3

Fixed some of the inline python statements to support makefile rules
in both python2 and python3

Signed-off-by: Adam Stokes <adam.stokes@ubuntu.com>