This is a very good question. See http://en.wikipedia.org/wiki/Avogadro's_number
One way was to use Bragg diffraction of x-rays to determine the lattice spacing of a pure crystal, and compute the number of atoms in the crystal by measuring its outside dimensions, and weighing the crystal to determine the mass of the crystal and the mass of one atom. Then you have a direct relation between the wavelength of the x-rays
E = hν = hc/λ
and the crystal spacing.
nλ = 2 d sin(θ)
Planck's constant was then determined by bombarding a high-Z x-ray target with electrons of known voltage V, energy eV= E, and measuring the end-point (minimum wavelength) of the continuous x-ray spectrum. Then
h = Eλ/c = eVλ/c
Another way of measuring Avagadro's number is to put a copper electrode in an electrolyte and remove about 96,000 Coulombs (1 Faraday) of copper by electrolysis, and measure the weight loss during electrolysis, knowing the gram atomic weight of copper to be 63.546 grams (which equals Avagadro's number of atoms). So then you need to know how many Coulombs of electrons are in one mole.
So all of the fundamental constants are related. See http://physics.nist.gov/cuu/Constants/historical1.html